<?php
/**
 * CreateKeyword
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Amazon Ads API - Sponsored Products
 *
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](guides/onboarding/overview) topic.<br/> <br/> **Note**: This contract contains endpoints with upcoming planned deprecations. For more information on the latest versions and migration details, see [Deprecations](release-notes/deprecations).<br/> <br/>
 *
 * OpenAPI spec version: 2.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * CreateKeyword Class Doc Comment
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class CreateKeyword implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'CreateKeyword';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'campaign_id' => 'float',
        'ad_group_id' => 'float',
        'state' => '\AmazonAdvertisingApi\Model\State',
        'keyword_text' => 'string',
        'native_language_keyword' => 'string',
        'native_language_locale' => 'string',
        'match_type' => '\AmazonAdvertisingApi\Model\MatchType',
        'bid' => 'float'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'campaign_id' => null,
        'ad_group_id' => null,
        'state' => null,
        'keyword_text' => null,
        'native_language_keyword' => null,
        'native_language_locale' => null,
        'match_type' => null,
        'bid' => 'float'
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'campaign_id' => 'campaignId',
        'ad_group_id' => 'adGroupId',
        'state' => 'state',
        'keyword_text' => 'keywordText',
        'native_language_keyword' => 'nativeLanguageKeyword',
        'native_language_locale' => 'nativeLanguageLocale',
        'match_type' => 'matchType',
        'bid' => 'bid'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'campaign_id' => 'setCampaignId',
        'ad_group_id' => 'setAdGroupId',
        'state' => 'setState',
        'keyword_text' => 'setKeywordText',
        'native_language_keyword' => 'setNativeLanguageKeyword',
        'native_language_locale' => 'setNativeLanguageLocale',
        'match_type' => 'setMatchType',
        'bid' => 'setBid'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'campaign_id' => 'getCampaignId',
        'ad_group_id' => 'getAdGroupId',
        'state' => 'getState',
        'keyword_text' => 'getKeywordText',
        'native_language_keyword' => 'getNativeLanguageKeyword',
        'native_language_locale' => 'getNativeLanguageLocale',
        'match_type' => 'getMatchType',
        'bid' => 'getBid'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['campaign_id'] = isset($data['campaign_id']) ? $data['campaign_id'] : null;
        $this->container['ad_group_id'] = isset($data['ad_group_id']) ? $data['ad_group_id'] : null;
        $this->container['state'] = isset($data['state']) ? $data['state'] : null;
        $this->container['keyword_text'] = isset($data['keyword_text']) ? $data['keyword_text'] : null;
        $this->container['native_language_keyword'] = isset($data['native_language_keyword']) ? $data['native_language_keyword'] : null;
        $this->container['native_language_locale'] = isset($data['native_language_locale']) ? $data['native_language_locale'] : null;
        $this->container['match_type'] = isset($data['match_type']) ? $data['match_type'] : null;
        $this->container['bid'] = isset($data['bid']) ? $data['bid'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets campaign_id
     *
     * @return float
     */
    public function getCampaignId()
    {
        return $this->container['campaign_id'];
    }

    /**
     * Sets campaign_id
     *
     * @param float $campaign_id The identifer of the campaign to which the keyword is associated.
     *
     * @return $this
     */
    public function setCampaignId($campaign_id)
    {
        $this->container['campaign_id'] = $campaign_id;

        return $this;
    }

    /**
     * Gets ad_group_id
     *
     * @return float
     */
    public function getAdGroupId()
    {
        return $this->container['ad_group_id'];
    }

    /**
     * Sets ad_group_id
     *
     * @param float $ad_group_id The identifier of the ad group to which this keyword is associated.
     *
     * @return $this
     */
    public function setAdGroupId($ad_group_id)
    {
        $this->container['ad_group_id'] = $ad_group_id;

        return $this;
    }

    /**
     * Gets state
     *
     * @return \AmazonAdvertisingApi\Model\State
     */
    public function getState()
    {
        return $this->container['state'];
    }

    /**
     * Sets state
     *
     * @param \AmazonAdvertisingApi\Model\State $state state
     *
     * @return $this
     */
    public function setState($state)
    {
        $this->container['state'] = $state;

        return $this;
    }

    /**
     * Gets keyword_text
     *
     * @return string
     */
    public function getKeywordText()
    {
        return $this->container['keyword_text'];
    }

    /**
     * Sets keyword_text
     *
     * @param string $keyword_text The keyword text.
     *
     * @return $this
     */
    public function setKeywordText($keyword_text)
    {
        $this->container['keyword_text'] = $keyword_text;

        return $this;
    }

    /**
     * Gets native_language_keyword
     *
     * @return string
     */
    public function getNativeLanguageKeyword()
    {
        return $this->container['native_language_keyword'];
    }

    /**
     * Sets native_language_keyword
     *
     * @param string $native_language_keyword The unlocalized keyword text in the preferred locale of the advertiser.
     *
     * @return $this
     */
    public function setNativeLanguageKeyword($native_language_keyword)
    {
        $this->container['native_language_keyword'] = $native_language_keyword;

        return $this;
    }

    /**
     * Gets native_language_locale
     *
     * @return string
     */
    public function getNativeLanguageLocale()
    {
        return $this->container['native_language_locale'];
    }

    /**
     * Sets native_language_locale
     *
     * @param string $native_language_locale The locale preference of the advertiser. For example, if the advertiser’s preferred language is Simplified Chinese, set the locale to `zh_CN`. Supported locales include: Simplified Chinese (locale: zh_CN) for US, UK and CA. English (locale: en_GB) for DE, FR, IT and ES.
     *
     * @return $this
     */
    public function setNativeLanguageLocale($native_language_locale)
    {
        $this->container['native_language_locale'] = $native_language_locale;

        return $this;
    }

    /**
     * Gets match_type
     *
     * @return \AmazonAdvertisingApi\Model\MatchType
     */
    public function getMatchType()
    {
        return $this->container['match_type'];
    }

    /**
     * Sets match_type
     *
     * @param \AmazonAdvertisingApi\Model\MatchType $match_type match_type
     *
     * @return $this
     */
    public function setMatchType($match_type)
    {
        $this->container['match_type'] = $match_type;

        return $this;
    }

    /**
     * Gets bid
     *
     * @return float
     */
    public function getBid()
    {
        return $this->container['bid'];
    }

    /**
     * Sets bid
     *
     * @param float $bid Bid associated with this keyword. Applicable to biddable match types only.
     *
     * @return $this
     */
    public function setBid($bid)
    {
        $this->container['bid'] = $bid;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
